import { configureStore } from '@reduxjs/toolkit';

import { api } from './services/main'
// import { addReducer } from './reducers/add';
import { addSlice } from './slices/add';


export const store = configureStore({
    reducer: {
        add: addSlice.reducer,
        [api.reducerPath]: api.reducer
    },
    middleware: (getDefaultMiddleware) =>
        getDefaultMiddleware().concat(api.middleware),
})

export type StateType = ReturnType<typeof store.getState>

// export const store = createStore(reducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());